<?php // no direct access
defined('_JEXEC') or die('Restricted access');
$cparams =& JComponentHelper::getParams('com_media');
?>

<?php if ($this->params->get('num_leading_articles') && $this->pagination->limitstart==0) : ?>
	<?php for ($i = $this->pagination->limitstart; $i < ($this->pagination->limitstart + $this->params->get('num_leading_articles')); $i++) : ?>
		<?php if ($i >= $this->total) : break; endif; ?>
		
		<?php
			$this->item =& $this->getItem($i, $this->params);
			echo $this->loadTemplate('item_leading');
		?>
		
	<?php endfor; ?>

<?php else : $i = $this->pagination->limitstart; endif; ?>
<div class="users_wrap usbottom clearfix">
<?php
if($this->pagination->limitstart == 0)
	$start =  $this->params->get('num_leading_articles');
else
	$start = $this->pagination->limitstart;
$end = $this->pagination->limitstart + $this->pagination->limit;
if($end>$this->pagination->total)
	$end = $this->pagination->total;
?>
	<div class="us_width-49b">
			<div class="moduletable">
				<div class="moduletable_content clearfix">
					<table cellspacing="0" cellpadding="0" id="newsshow5" class="gk_news_show_table">
						<tbody>
							<?php for($i=$start;$i<$end;$i=$i+2):?>
							<?php
								$this->item =& $this->getItem($i, $this->params);
								echo $this->loadTemplate('item');
							?>
							<?php endfor;?>
						</tbody>
					</table>
				</div>
			</div> 
		</div>
		<div class="us_width-49b">
			<div class="moduletable">
				<div class="moduletable_content clearfix">
					<table cellspacing="0" cellpadding="0" id="newsshow5" class="gk_news_show_table">
						<tbody>
							<?php for($i=$start+1;$i<$end;$i=$i+2):?>
							<?php
								$this->item =& $this->getItem($i, $this->params);
								echo $this->loadTemplate('item');
							?>
							<?php endfor;?>
						</tbody>
					</table>
				</div>
			</div>
		</div>
</div>
<div>
<br/><br/><br/>
<center>
<?php  if ($this->params->get('show_pagination')) : ?>

		<?php echo $this->pagination->getPagesLinks(); ?>

<?php endif; ?>
<br/>
<?php if ($this->params->get('show_pagination_results')) : ?>
		<?php echo $this->pagination->getPagesCounter(); ?>
<?php endif;?>
</center>
</div>
